<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<title><spring:message code="message.lable.compinfoSTDlog"/></title>
	 <%@ include file="/WEB-INF/component/commonCSS.jsp" %>
    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1><spring:message code="message.lable.compinfoSTDlog"/></h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.StdManage"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.compinfoStd"/></a></li>
            
        </ol>
    </section>
    
     <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class=" form-inline">
                     <div class="form-group form-group-xs">
                        <label for="searchPharCode"><spring:message code="message.listForm.xiuGaiRiQi"/>：</label>
                        <input class="form-control" id="date1"   name="date1" type="text" placeholder="yyyy-MM-dd" 
                         onFocus="var endDate=$dp.$('date2');WdatePicker({maxDate:'#F{$dp.$D(\'date2\')}'})" />
                        <label>-</label>
                        <input class="form-control" type="text" id="date2" name="date2"  placeholder="yyyy-MM-dd" maxlength="10"  
                         onFocus="WdatePicker({minDate:'#F{$dp.$D(\'date1\')}'})" />
                   
                   
                    </div>
                     
                    <button type="button" onclick="likeQuery();" class="btn btn-success btn-sm" id="selectGroup"><spring:message code="message.button.seachSpacing"/></button>
                </div>
            </div>
        </div>
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
         <div class=" box box-warning bottongroup">
               ${compGroupId==null?"":"<!--" } <a href="${ctx}/stdCompinfo/stdCompinfoListJsp.html" class="btn btn-default btn-sm"><spring:message code="message.button.getBackSpacing"/></a>${compGroupId==null?"":"-->" }
               ${compGroupId==null?"<!--":"" } <a href="${ctx}/stdCompGroup/stdCompGroupSubC.html?tid=${compGroupId}" class="btn btn-default btn-sm"><spring:message code="message.button.getBackSpacing"/></a>${compGroupId==null?"-->":"" }
        </div>
    </section>
      <%@ include file="/WEB-INF/component/commonJS.jsp" %>
    <script src="${ctx}/lib/plugins/daterangepicker/moment.js"></script>
    <script src="${ctx}/lib/plugins/daterangepicker/daterangepicker.js"></script>
    <script type="text/javascript">
    
	    //绑定回车
	    $('#date1,#date2').bind('keydown', function(event) {
	        if (event.keyCode == "13") {        //13 位电脑上回车键的位置代码
	            $('#selectGroup').click();
	        }
	    }); 
        $(function () {
        	
            $("#gridlist").jqGrid({
                url: "${ctx}/stdCompinfoLog/stdCompinfoLogList.html",
                mtype: "post",
                datatype: "json",
                postData: {"compId" : "${compId}"},
                autowidth: true,
                sortable : false,
                //shrinkToFit:false,
                height: 270,
                colNames: ['<spring:message code="message.jqGrid.cz"/>',
                           '<spring:message code="message.listForm.xiuGaiXiangQing"/>',
                           'id','企业编码', '企业名称','企业类型','组织机构代码','所属地区', '企业注册类型', '状态', 
                           '<spring:message code="message.listForm.xiuGaiRen"/>',
                           '<spring:message code="message.listForm.xiuGaiShiJian"/>'
                           ],
                colModel: [
					
					{ name: 'operate', width: 80, align:"center",sortable : false,
						formatter : function(val, opts,rowdata) {
						var str = "<a href='${ctx}/stdCompinfoDetail/stdCompinfoDetailListJsp.html?compId="+rowdata.compId+"&updDatetime="+rowdata.updDatetimeStr+"' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -100px 0px' class='opIcon' title='<spring:message code="message.jqGrid.cz.xiangQing"/>'></a>";
						return str;
						}	
					},
					{ name: 'detail',width: 700, align:"left",sortable : false },
                    {name: 'compId', width: 30,hidden:true, align:"center",sortable : false},
					{ name: 'compCode', width: 180, align:"center",sortable : false,hidden:true },
					{ name: 'compName', width: 200, align:"left" ,sortable : false,hidden:true},
					{ name: 'compType', width: 100, align:"center",sortable : false,hidden:true},
					{ name: 'orgCode', width: 120, align:"center",sortable : false,hidden:true },
                    { name: 'arfullname', width:180, align:"center",sortable : false ,hidden:true},
                    { name: 'compRegName', width: 120, align:"center",sortable : false ,hidden:true},
                    { name: 'status',width: 80, align:"center",sortable : false,hidden:true},
                    { name: 'updUser',width: 120, align:"center",sortable : false },
                    { name: 'updDatetimeStr',width: 160, align:"center",sortable : false}
                ],
                rowNum: 20,
                rowList: [10, 20, 50,100],
                rownumbers: true,
                pager: "#gridpage",
                viewrecords: true,
                gridComplete: function(){
                	var page = $("#gridlist").jqGrid('getGridParam','page');
            		var rows = $('#gridlist').getGridParam("rowNum"); 
            		var maxnum = (rows*page).toString();
            		var len = (maxnum.length)*10;
            		$('.jqgfirstrow').find('td').eq(0).css('width',len+'px');
                	$('#gridlist_rn').css('width',len+'px');
                },
                caption: "${compCode} - ${compName}&nbsp;<spring:message code="message.jqGrid.cz.weiHuJiLuLieBiao"/>",
                jsonReader: {
                    repeatitems: false,
                    id: "ids"
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
            
        });
        
        //查询
        function likeQuery() {
    		var date1 = $("#date1").val();
         	if (date1.length>0){
         		date1 = date1 + " 00:00:00";
         	}
         	var date2 = $("#date2").val();
         	if (date2.length>0){
         		date2 = date2 + " 23:59:59";
         	}
    		$("#gridlist").jqGrid('setGridParam',{  
    	        datatype:'json',
    	        postData:{
    	        	"date1":date1, 
    	        	"date2":date2
    	        },
    	        page : 1
    	    }).trigger("reloadGrid"); //重新载入  
    	}
       
    </script>
</body>
</html>